package com.example.everying.service.content;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.everying.constant.ArticleStatus;
import com.example.everying.model.entity.content.ActivityArticle;
import com.example.everying.model.entity.content.ActivityAudit;
import com.example.everying.model.vo.content.ActivityArticleVo;
import com.example.everying.model.vo.content.ApplyViewVo;
import com.example.everying.utils.Result;

import java.util.List;

public interface ActivityArticleService extends IService<ActivityArticle> {
    Boolean articleAdd(ActivityArticleVo ActivityArticleEntityVo);

    // 更新订单
    boolean updateOrder(ActivityArticle activityArticle, Integer points, String userId);

    IPage<ActivityArticle> selectPage(Page<ActivityArticle> pageParam, ActivityArticleVo applyVo);
    /**
     * 关联用户表分页查询文章
     */
    IPage<ActivityArticleVo> selectPageWithUser(Page<ActivityArticleVo> pageParam, ActivityArticleVo articleVo);

    ActivityAudit getByCid(String cid);

    void viewsEdit(String id);

    /**
     * 更新文章点赞数
     */
    boolean updateLikesCount(String articleId, Integer count);

    ActivityArticle articleId(String articleId);

    IPage<ActivityArticleVo> publishSelect(Page<ActivityArticleVo> pageParam,String userId,String tokenId,String status);

    IPage<ActivityArticleVo> parSelect(Page<ActivityArticleVo> pageParam,String userId,String tokenId,String status);

    ActivityArticle getArticleById(String id);

    List<ActivityArticle> bannerList();

    boolean updateByUserID(String userId);

    List<ActivityArticle> getArticleByStatus(String status);

    Result<?> articleEdit(ActivityArticleVo article);

    Result<?> delete(String id);

    IPage<ActivityArticleVo> selectByUser(Page<ActivityArticleVo> pageParam,String userId,String status, String id);

    // 处理活动积分领取记录
    void handleActivityPoints(ActivityArticle activityArticle);

    ApplyViewVo artView(String userId);

    ApplyViewVo appView(String userId);

    int artViewRead(String id, String status,String artId);

    int appViewRead(String status, String artId);

//    String getApplyStatus(String ordersStatus, String articleStatus);

    String getApplyStatus(String ordersStatus, String articleStatus, Integer articleType);

    String getRefundUserId(ActivityArticle activityArticle);

    ActivityArticleVo artTask(ActivityArticleVo article);

    IPage<ActivityArticle> bannerPage(Page<ActivityArticle> pageParam, ActivityArticle query);

    Boolean articleAdd2();

    String getUserPhone(String articleId);
}
